package f_collection;

import java.util.HashSet;
import java.util.Iterator;


public class HashSetEx2 {
	public HashSetEx2(){
		HashSet<String> hs = new HashSet<String>();
		// 입력
		hs.add("1111");hs.add("2222");hs.add("3333");
		System.out.println("입력 : " + hs.toString());

		//조회
		boolean f = hs.contains("3333");
		if(f) System.out.println("3333 있음");
		else  System.out.println("3333 없음");
		// 수정
		hs.remove("3333");
		hs.add("4444");
		System.out.println("수정 후 : " + hs.toString());
		//삭제
		hs.remove("2222");
		System.out.println("삭제 후 : " + hs.toString());
	}
	public static void main(String[] args) {
		new HashSetEx2();
	}
}
